import request from '@/utils/request'

// 查询客户列表
export function listCustomers(query) {
  return request({
    url: '/customers/customer/list',
    method: 'get',
    params: query
  })
}

// 查询客户详细
export function getCustomer(id) {
  return request({
    url: '/customers/customer/detail/' + id,
    method: 'get'
  })
}

// 新增客户
export function addCustomer(data) {
  return request({
    url: '/customers/customer/add',
    method: 'post',
    data: data
  })
}

// 修改客户
export function updateCustomer(data) {
  return request({
    url: '/customers/customer/update',
    method: 'put',
    data: data
  })
}

// 删除客户
export function deleteCustomer(id) {
  return request({
    url: '/customers/customer/deleteById/' + id,
    method: 'delete'
  })
}

// 批量删除客户
export function deleteCustomers(ids) {
  return request({
    url: '/customers/customer/deleteByIds/' + ids,
    method: 'delete'
  })
}

// 导出客户
export function exportCustomer(query) {
  return request({
    url: '/customer/customers/export',
    method: 'get',
    params: query
  })
}
